<!DOCTYPE html>
<HTML>
<HEAD><meta name="viewport" content="width=device-width, initial-scale=1">
<Title>XYChart</Title>
<link type='text/css' rel='Stylesheet' href="maxchartapi.css" />
</HEAD>
<body bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0" rightmargin="0" marginwidth="0" marginheight="0">

<p class="heading0">ChartDirector 7.0 (Java Edition)</p>
<p class="heading1">XYChart</p>
<hr class="separator">
<div class="content">
The XYChart class represents XY charts. The XYChart class is a subclass of <a href="BaseChart.htm">BaseChart</a>.
<br><br>
<div style="width:100%;box-sizing:border-box;">
<table border="1" cellpadding="5" cellspacing="0" width="100%"> 
<tr>
<th width="19%">Method</th><th width="19%">Inherited</th><th>Description</th>
</tr>
<tr>
<td><a href="XYChart.XYChart.htm">XYChart</a></td><td>(Self)</td><td>Creates a new <a href="XYChart.htm">XYChart</a> object.</td></tr><tr><td><a href="XYChart.yAxis.htm">yAxis</a></td><td>(Self)</td><td>Retrieves the <a href="Axis.htm">Axis</a> object representing the primary y-axis of the XYChart.</td></tr><tr><td><a href="XYChart.yAxis2.htm">yAxis2</a></td><td>(Self)</td><td>Retrieves the <a href="Axis.htm">Axis</a> object representing the secondary y-axis of the XYChart.</td></tr><tr><td><a href="XYChart.syncYAxis.htm">syncYAxis</a></td><td>(Self)</td><td>Sets a linear formula to synchronize the secondary y-axis scale to the primary y-axis scale.</td></tr><tr><td><a href="XYChart.setYAxisOnRight.htm">setYAxisOnRight</a></td><td>(Self)</td><td>Interchange the position of the primary y-axis and the secondary y-axis.</td></tr><tr><td><a href="XYChart.xAxis.htm">xAxis</a></td><td>(Self)</td><td>Retrieves the <a href="Axis.htm">Axis</a> object representing the primary x-axis of the XYChart.</td></tr><tr><td><a href="XYChart.xAxis2.htm">xAxis2</a></td><td>(Self)</td><td>Retrieves the <a href="Axis.htm">Axis</a> object representing the secondary x-axis of the XYChart.</td></tr><tr><td><a href="XYChart.setXAxisOnTop.htm">setXAxisOnTop</a></td><td>(Self)</td><td>Interchange the position of the primary x-axis and the secondary x-axis.</td></tr><tr><td><a href="XYChart.setAxisAtOrigin.htm">setAxisAtOrigin</a></td><td>(Self)</td><td>Sets the chart into 4 quadrant mode. The axes may intersect at origin inside the plot area (as opposed to at the border of the plot area).</td></tr><tr><td><a href="XYChart.addAxis.htm">addAxis</a></td><td>(Self)</td><td>Adds an additional axis to the chart.</td></tr><tr><td><a href="XYChart.swapXY.htm">swapXY</a></td><td>(Self)</td><td>Swap the position of the x and y axes, so the x-axes will become vertical, and the y-axes will become horizontal.</td></tr><tr><td><a href="XYChart.setPlotArea.htm">setPlotArea</a></td><td>(Self)</td><td>Sets the position, size, background colors, edge color and grid colors of the plot area.</td></tr><tr><td><a href="XYChart.getPlotArea.htm">getPlotArea</a></td><td>(Self)</td><td>Gets the <a href="PlotArea.htm">PlotArea</a> object representing the plot area.</td></tr><tr><td><a href="XYChart.packPlotArea.htm">packPlotArea</a></td><td>(Self)</td><td>Adjusts the plot area size and position to fit the plot area and the axis labels in a bounding box.</td></tr><tr><td><a href="XYChart.setClipping.htm">setClipping</a></td><td>(Self)</td><td>Enables clipping on the plot area.</td></tr><tr><td><a href="XYChart.setTrimData.htm">setTrimData</a></td><td>(Self)</td><td>Uses only a subset of the data series to draw charts.</td></tr><tr><td><a href="XYChart.addBarLayer.htm">addBarLayer</a></td><td>(Self)</td><td>Adds a bar layer to the XYChart, and specify the data set to use for drawing the bars.</td></tr><tr><td><a href="XYChart.addBarLayer2.htm">addBarLayer2</a></td><td>(Self)</td><td>Adds an empty bar layer to the XYChart.</td></tr><tr><td><a href="XYChart.addBarLayer3.htm">addBarLayer3</a></td><td>(Self)</td><td>Adds a multi-color bar layer to the XYChart, and specify the data set to use for drawing the bars.</td></tr><tr><td><a href="XYChart.addLineLayer.htm">addLineLayer</a></td><td>(Self)</td><td>Adds a line layer to the XYChart, and specify the data set to use for drawing the line.</td></tr><tr><td><a href="XYChart.addLineLayer2.htm">addLineLayer2</a></td><td>(Self)</td><td>Adds an empty line layer to the XYChart.</td></tr><tr><td><a href="XYChart.addLineLayer3.htm">addLineLayer3</a></td><td>(Self)</td><td>Adds a line layer using data from a <a href="DataAccelerator.htm">DataAccelerator</a>.</td></tr><tr><td><a href="XYChart.addSplineLayer.htm">addSplineLayer</a></td><td>(Self)</td><td>Adds a spline layer to the XYChart.</td></tr><tr><td><a href="XYChart.addStepLineLayer.htm">addStepLineLayer</a></td><td>(Self)</td><td>Adds a step line chart layer to the XYChart.</td></tr><tr><td><a href="XYChart.addTrendLayer.htm">addTrendLayer</a></td><td>(Self)</td><td>Adds a trend chart layer to the XYChart, and specify the data set to use for drawing the trend line.</td></tr><tr><td><a href="XYChart.addTrendLayer2.htm">addTrendLayer2</a></td><td>(Self)</td><td>Adds a trend chart layer to the XYChart, and specify the x and y values for drawing the trend line.</td></tr><tr><td><a href="XYChart.addInterLineLayer.htm">addInterLineLayer</a></td><td>(Self)</td><td>Adds an inter-line layer the XYChart. An inter-line layer is used to fill the region between any two lines (straight lines, spline curves, step lines, etc).</td></tr><tr><td><a href="XYChart.addScatterLayer.htm">addScatterLayer</a></td><td>(Self)</td><td>Adds a scatter chart layer to the XYChart.</td></tr><tr><td><a href="XYChart.addAreaLayer.htm">addAreaLayer</a></td><td>(Self)</td><td>Adds an area chart layer to the XYChart, and specify the data set to use for drawing the area.</td></tr><tr><td><a href="XYChart.addAreaLayer2.htm">addAreaLayer2</a></td><td>(Self)</td><td>Adds an empty area chart layer to the XYChart.</td></tr><tr><td><a href="XYChart.addBoxWhiskerLayer.htm">addBoxWhiskerLayer</a></td><td>(Self)</td><td>Adds a box-whisker layer to the XYChart, and specify the data sets to use for drawing the layer.</td></tr><tr><td><a href="XYChart.addBoxWhiskerLayer2.htm">addBoxWhiskerLayer2</a></td><td>(Self)</td><td>Adds a multi-color box-whisker layer to the XYChart, and specify the data sets to use for drawing the layer.</td></tr><tr><td><a href="XYChart.addBoxLayer.htm">addBoxLayer</a></td><td>(Self)</td><td>Adds a floating box layer to the XYChart, and specify the data sets to use for drawing the layer.</td></tr><tr><td><a href="XYChart.addVectorLayer.htm">addVectorLayer</a></td><td>(Self)</td><td>Adds a vector layer to the chart.</td></tr><tr><td><a href="XYChart.addHLOCLayer.htm">addHLOCLayer</a></td><td>(Self)</td><td>Adds a high-low-open-close (HLOC) layer to the XYChart, and specify the data sets to use for drawing the layer.</td></tr><tr><td><a href="XYChart.addHLOCLayer2.htm">addHLOCLayer2</a></td><td>(Self)</td><td>Adds an empty high-low-open-close (HLOC) layer to the XYChart.</td></tr><tr><td><a href="XYChart.addHLOCLayer3.htm">addHLOCLayer3</a></td><td>(Self)</td><td>Adds a multi-color high-low-open-close (HLOC) layer to the XYChart, and specify the data sets to use for drawing the layer.</td></tr><tr><td><a href="XYChart.addCandleStickLayer.htm">addCandleStickLayer</a></td><td>(Self)</td><td>Adds a candlestick layer to the XYChart, and specify the data sets to use for drawing the layer.</td></tr><tr><td><a href="XYChart.addContourLayer.htm">addContourLayer</a></td><td>(Self)</td><td>Adds a contour layer to the XYChart, and specify the data to use for drawing the layer.</td></tr><tr><td><a href="XYChart.addDiscreteHeatMapLayer.htm">addDiscreteHeatMapLayer</a></td><td>(Self)</td><td>Adds a discrete heat map layer to the XYChart by specifying the cell values and the cell count in the x direction.</td></tr><tr><td><a href="XYChart.addDiscreteHeatMapLayer2.htm">addDiscreteHeatMapLayer2</a></td><td>(Self)</td><td>Adds a discrete heat map layer to the XYChart by specifying the cell values and positions.</td></tr><tr><td><a href="XYChart.getLayer.htm">getLayer</a></td><td>(Self)</td><td>Gets a <a href="Layer.htm">Layer</a> object based on the order in which it is being added to the chart.</td></tr><tr><td><a href="XYChart.getLayerByZ.htm">getLayerByZ</a></td><td>(Self)</td><td>Gets a <a href="Layer.htm">Layer</a> object based on the order in which it is being drawn.</td></tr><tr><td><a href="XYChart.getLayerCount.htm">getLayerCount</a></td><td>(Self)</td><td>Gets the number of layers in the chart.</td></tr><tr><td><a href="XYChart.layoutAxes.htm">layoutAxes</a></td><td>(Self)</td><td>Performs axis auto-scaling and sets the axis positions and lengths.</td></tr><tr><td><a href="XYChart.getXCoor.htm">getXCoor</a></td><td>(Self)</td><td>Gets the x pixel coordinate given the x data value.</td></tr><tr><td><a href="XYChart.getYCoor.htm">getYCoor</a></td><td>(Self)</td><td>Gets the y pixel coordinate given the y data value.</td></tr><tr><td><a href="XYChart.getXValue.htm">getXValue</a></td><td>(Self)</td><td>Gets the x data value given the x pixel coordinate.</td></tr><tr><td><a href="XYChart.getYValue.htm">getYValue</a></td><td>(Self)</td><td>Gets the y data value given the y pixel coordinate.</td></tr><tr><td><a href="XYChart.getNearestXValue.htm">getNearestXValue</a></td><td>(Self)</td><td>Gets the x data value that is nearest to the specified x pixel coordinate.</td></tr><tr><td><a href="XYChart.xZoneColor.htm">xZoneColor</a></td><td>(Self)</td><td>Creates an x-zone color. An x-zone color will change from one color to another depending on a threshold value on the x-axis.</td></tr><tr><td><a href="XYChart.yZoneColor.htm">yZoneColor</a></td><td>(Self)</td><td>Creates a y-zone color. A y-zone color will change from one color to another depending on a threshold value on the y-axis.</td></tr><tr><td><a href="XYChart.xScaleColor.htm">xScaleColor</a></td><td>(Self)</td><td>Creates an x-scale color. An x-scale is a color that will vary depending on the x value of the pixel.</td></tr><tr><td><a href="XYChart.yScaleColor.htm">yScaleColor</a></td><td>(Self)</td><td>Creates a y-scale color. An y-scale is a color that will vary depending on the y value of the pixel.</td></tr><tr><td><a href="BaseChart.setSize.htm">setSize</a></td><td>BaseChart</td><td>Sets the size of the chart, exclusive of the drop shadow (if any).</td></tr><tr><td><a href="BaseChart.getWidth.htm">getWidth</a></td><td>BaseChart</td><td>Gets the width of the chart.</td></tr><tr><td><a href="BaseChart.getHeight.htm">getHeight</a></td><td>BaseChart</td><td>Gets the height of the chart.</td></tr><tr><td><a href="BaseChart.getAbsOffsetX.htm">getAbsOffsetX</a></td><td>BaseChart</td><td>Gets the x offset of the chart relative to the outermost <a href="MultiChart.htm">MultiChart</a> container.</td></tr><tr><td><a href="BaseChart.getAbsOffsetY.htm">getAbsOffsetY</a></td><td>BaseChart</td><td>Gets the y offset of the chart relative to the outermost <a href="MultiChart.htm">MultiChart</a> container.</td></tr><tr><td><a href="BaseChart.setBackground.htm">setBackground</a></td><td>BaseChart</td><td>Sets the background color, border color and 3D border effect of the chart.</td></tr><tr><td><a href="BaseChart.setRoundedFrame.htm">setRoundedFrame</a></td><td>BaseChart</td><td>Sets the border style of the chart to rounded corners.</td></tr><tr><td><a href="BaseChart.setThickFrame.htm">setThickFrame</a></td><td>BaseChart</td><td>Sets a thick frame around the chart.</td></tr><tr><td><a href="BaseChart.setDropShadow.htm">setDropShadow</a></td><td>BaseChart</td><td>Adds a drop shadow to the chart.</td></tr><tr><td><a href="BaseChart.setBorder.htm">setBorder</a></td><td>BaseChart</td><td>Sets the border color of the chart.</td></tr><tr><td><a href="BaseChart.setWallpaper.htm">setWallpaper</a></td><td>BaseChart</td><td>Uses the image from the specified file or resource as the wallpaper to fill the background of the chart.</td></tr><tr><td><a href="BaseChart.setBgImage.htm">setBgImage</a></td><td>BaseChart</td><td>Uses the image from the specified file or resource as the background image of the chart.</td></tr><tr><td><a href="BaseChart.setSearchPath.htm">setSearchPath</a></td><td>BaseChart</td><td>Sets the search path for loading image files.</td></tr><tr><td><a href="BaseChart.setSearchPath2.htm">setSearchPath2</a></td><td>BaseChart</td><td>Sets the ClassLoader for loading images.</td></tr><tr><td><a href="BaseChart.setSearchPath3.htm">setSearchPath3</a></td><td>BaseChart</td><td>Search for image files using the ServletContext and ServletRequest.</td></tr><tr><td><a href="BaseChart.setSearchPath4.htm">setSearchPath4</a></td><td>BaseChart</td><td>Search for image files using a URL as the base path.</td></tr><tr><td><a href="BaseChart.setResource.htm">setResource</a></td><td>BaseChart</td><td>Assigns a resource ID to a memory block to allow it to be referenced using a resource path.</td></tr><tr><td><a href="BaseChart.setResource2.htm">setResource2</a></td><td>BaseChart</td><td>Assigns a resource ID to a <a href="DrawArea.htm">DrawArea</a> object to allow it to be referenced using a resource path.</td></tr><tr><td><a href="BaseChart.setTransparentColor.htm">setTransparentColor</a></td><td>BaseChart</td><td>Specifies a certain color to mean transparent when creating a raster image output.</td></tr><tr><td><a href="BaseChart.setAntiAlias.htm">setAntiAlias</a></td><td>BaseChart</td><td>Controls whether anti-alias is used when drawing lines, shapes and text.</td></tr><tr><td><a href="BaseChart.addTitle.htm">addTitle</a></td><td>BaseChart</td><td>Adds a title at the top center of the chart.</td></tr><tr><td><a href="BaseChart.addTitle2.htm">addTitle2</a></td><td>BaseChart</td><td>Adds a title to the chart.</td></tr><tr><td><a href="BaseChart.addLegend.htm">addLegend</a></td><td>BaseChart</td><td>Adds a legend box to the chart.</td></tr><tr><td><a href="BaseChart.addLegend2.htm">addLegend2</a></td><td>BaseChart</td><td>Adds a legend box to the chart with grid layout.</td></tr><tr><td><a href="BaseChart.getLegend.htm">getLegend</a></td><td>BaseChart</td><td>Gets the <a href="LegendBox.htm">LegendBox</a> object representing the legend box in the chart.</td></tr><tr><td><a href="BaseChart.layoutLegend.htm">layoutLegend</a></td><td>BaseChart</td><td>Lays out and gets the <a href="LegendBox.htm">LegendBox</a> object representing the legend box in the chart.</td></tr><tr><td><a href="BaseChart.getDrawArea.htm">getDrawArea</a></td><td>BaseChart</td><td>Retrieves the internal <a href="DrawArea.htm">DrawArea</a> object that is used to draw the chart.</td></tr><tr><td><a href="BaseChart.addText.htm">addText</a></td><td>BaseChart</td><td>Adds a text box to the chart.</td></tr><tr><td><a href="BaseChart.addTable.htm">addTable</a></td><td>BaseChart</td><td>Adds a CDML table to the chart.</td></tr><tr><td><a href="BaseChart.addLine.htm">addLine</a></td><td>BaseChart</td><td>Adds a line to the chart.</td></tr><tr><td><a href="BaseChart.addExtraField.htm">addExtraField</a></td><td>BaseChart</td><td>Adds an array of text to be used as an extra field in various places.</td></tr><tr><td><a href="BaseChart.addExtraField2.htm">addExtraField2</a></td><td>BaseChart</td><td>Adds an array of numbers/dates to be used as an extra field in various places.</td></tr><tr><td><a href="BaseChart.setColor.htm">setColor</a></td><td>BaseChart</td><td>Change the color at the specified position in the palette.</td></tr><tr><td><a href="BaseChart.setColors.htm">setColors</a></td><td>BaseChart</td><td>Change the colors in the palette.</td></tr><tr><td><a href="BaseChart.setColors2.htm">setColors2</a></td><td>BaseChart</td><td>Change the colors in the palette, starting from the specified position in the palette.</td></tr><tr><td><a href="BaseChart.getColor.htm">getColor</a></td><td>BaseChart</td><td>Gets the color at the specified position of the palette.</td></tr><tr><td><a href="BaseChart.adjustBrightness.htm">adjustBrightness</a></td><td>BaseChart</td><td>Creates a color that is a darkened or brightened version of the given color.</td></tr><tr><td><a href="BaseChart.halfColor.htm">halfColor</a></td><td>BaseChart</td><td>Creates a color that is half the intensity of the given color.</td></tr><tr><td><a href="BaseChart.dashLineColor.htm">dashLineColor</a></td><td>BaseChart</td><td>Creates a dash line color.</td></tr><tr><td><a href="BaseChart.patternColor.htm">patternColor</a></td><td>BaseChart</td><td>Creates a pattern color using an array of colors as the bitmap pattern.</td></tr><tr><td><a href="BaseChart.patternColor2.htm">patternColor2</a></td><td>BaseChart</td><td>Creates a pattern color by using the image from the specified file or resource as the pattern.</td></tr><tr><td><a href="BaseChart.linearGradientColor.htm">linearGradientColor</a></td><td>BaseChart</td><td>Creates a two-point linear gradient color.</td></tr><tr><td><a href="BaseChart.linearGradientColor2.htm">linearGradientColor2</a></td><td>BaseChart</td><td>Creates a multi-point linear gradient color.</td></tr><tr><td><a href="BaseChart.radialGradientColor.htm">radialGradientColor</a></td><td>BaseChart</td><td>Creates a two-point radial gradient color.</td></tr><tr><td><a href="BaseChart.radialGradientColor2.htm">radialGradientColor2</a></td><td>BaseChart</td><td>Creates a multi-point radial gradient color.</td></tr><tr><td><a href="BaseChart.gradientColor.htm">gradientColor</a></td><td>BaseChart</td><td>Creates a two-point linear gradient color.</td></tr><tr><td><a href="BaseChart.gradientColor2.htm">gradientColor2</a></td><td>BaseChart</td><td>Creates a multi-point linear gradient color.</td></tr><tr><td><a href="BaseChart.setDefaultFonts.htm">setDefaultFonts</a></td><td>BaseChart</td><td>Sets the defaults for normal, bold, italic and bold-italic fonts.</td></tr><tr><td><a href="BaseChart.setFontTable.htm">setFontTable</a></td><td>BaseChart</td><td>Sets an entry in the font table to the specified font name.</td></tr><tr><td><a href="BaseChart.formatValue.htm">formatValue</a></td><td>BaseChart</td><td>Formats a number/date using the ChartDirector formatting syntax as is in <a href="paramsub.htm">Parameter Substitution and Formatting</a>.</td></tr><tr><td><a href="BaseChart.setNumberFormat.htm">setNumberFormat</a></td><td>BaseChart</td><td>Sets the characters used for thousand separator, decimal point, and negative sign.</td></tr><tr><td><a href="BaseChart.setMonthNames.htm">setMonthNames</a></td><td>BaseChart</td><td>Sets the names of the months for date/time formatting purposes.</td></tr><tr><td><a href="BaseChart.setWeekDayNames.htm">setWeekDayNames</a></td><td>BaseChart</td><td>Sets the names of the week days for date/time formatting purposes.</td></tr><tr><td><a href="BaseChart.setAMPM.htm">setAMPM</a></td><td>BaseChart</td><td>Sets the names to be used to denote morning and afternoon.</td></tr><tr><td><a href="BaseChart.layout.htm">layout</a></td><td>BaseChart</td><td>Perform auto-scaling of the axes (if any) and compute the positions of the various objects in the chart.</td></tr><tr><td><a href="BaseChart.makeImage.htm">makeImage</a></td><td>BaseChart</td><td>Generates the chart as a java.awt.Image object.</td></tr><tr><td><a href="BaseChart.enableVectorOutput.htm">enableVectorOutput</a></td><td>BaseChart</td><td>This method is deprecated. It has no effect and may be removed in future versions of ChartDirector.</td></tr><tr><td><a href="BaseChart.setOutputOptions.htm">setOutputOptions</a></td><td>BaseChart</td><td>Sets output format options for the next chart output.</td></tr><tr><td><a href="BaseChart.makeChart.htm">makeChart</a></td><td>BaseChart</td><td>Generates the chart image and save it into a file.</td></tr><tr><td><a href="BaseChart.makeChart2.htm">makeChart2</a></td><td>BaseChart</td><td>Generates the chart as an image in memory.</td></tr><tr><td><a href="BaseChart.makeChart3.htm">makeChart3</a></td><td>BaseChart</td><td>Generates the chart in internal format and return a <a href="DrawArea.htm">DrawArea</a> object to allow adding custom drawings on top of the chart.</td></tr><tr><td><a href="BaseChart.makeSession.htm">makeSession</a></td><td>BaseChart</td><td>Generates the chart as an image, saves it to a session variable and returns query parameters for loading the image.</td></tr><tr><td><a href="BaseChart.makeTmpFile.htm">makeTmpFile</a></td><td>BaseChart</td><td>Generates the chart as an image and save it to a temporary file, and automatically remove old files.</td></tr><tr><td><a href="BaseChart.initDynamicLayer.htm">initDynamicLayer</a></td><td>BaseChart</td><td>Initializes a dynamic layer for drawing text and shapes.</td></tr><tr><td><a href="BaseChart.removeDynamicLayer.htm">removeDynamicLayer</a></td><td>BaseChart</td><td>Removes the dynamic layer if any.</td></tr><tr><td><a href="BaseChart.getHTMLImageMap.htm">getHTMLImageMap</a></td><td>BaseChart</td><td>Generates an HTML image map to define hot spots and tooltips for the chart.</td></tr><tr><td><a href="BaseChart.getJsChartModel.htm">getJsChartModel</a></td><td>BaseChart</td><td>Gets the <a href="jschartmodel.htm">Javascript Chart Model</a> for passing to <a href="WebChartViewer.setChartModel.htm">WebChartViewer.setChartModel</a> for the purpose of supporting track cursors in a web application.</td></tr><tr><td><a href="BaseChart.getChartMetrics.htm">getChartMetrics</a></td><td>BaseChart</td><td>Gets the chart metrics for passing to <a href="WebChartViewer.setChartMetrics.htm">WebChartViewer.setChartMetrics</a>  to support viewports for web applications.</td>
</tr>
</table>
</div>

</div>
<hr class="separator"><div class="copyright">&copy; 2022 Advanced Software Engineering Limited. All rights reserved.</div>
</body>
</HTML>
